//
//  ZXSearchViewController.m
//  ZhuoxinAgriculture
//
//  Created by maxine on 2016/11/10.
//  Copyright © 2016年 KKING. All rights reserved.
//

#import "ZXSearchViewController.h"

@interface ZXSearchViewController ()
@property (weak, nonatomic) IBOutlet UITextField *searchTextField;

@end

@implementation ZXSearchViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    UIImageView *searchIcon = [[UIImageView alloc] init];
    searchIcon.image = [UIImage imageNamed:@"01-icon-search"];
    searchIcon.bounds = CGRectMake(0, 0, 30, 30);
    // contentMode：default is UIViewContentModeScaleToFill，要设置为UIViewContentModeCenter：使图片居中，防止图片填充整个imageView
    searchIcon.contentMode = UIViewContentModeCenter;
    self.searchTextField.leftViewMode = UITextFieldViewModeAlways;
    self.searchTextField.leftView = searchIcon;

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
